Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A runner for machines written in JavaScript. Machines are atomic, context-free bits of code which conform to the machine specification: an open standard for functions and subroutines.
Chances are you don't need to use this module directly- see About This Module below for info.
# Get the machine runner
$ npm install machine --save
If you're interested in contributing to the machine specification, please request to join the project's Google Group and introduce yourself to the rest of the core team. In the mean time, you can check out the tests for information on how to use all the lower-level features of this module. There is also a guide for direct usage of this module in docs/DIRECT_USAGE.md
. Note that you can run the tests for this module using npm test
. To re-generate the recursive dependency report (via the licensing
module by 3rdEden), run npm run licensing
.
Make sure you've read the issue submission guidelines from Sails before opening a new issue - the node-machine project uses the same rules.
Click here to search/post issues in this repository.
Before you read any further, let's stop and make sure you're in the right place. The documentation in this README file is for low-level usage of machine
, the JavaScript machine runner. You don't need to use this module directly unless you're building machines.
You can find more information about the node-machine project on http://node-machine.org. There you'll also find a short video from the introductory talk at dotjs.eu, an up-to-date list of all available machines on NPM, and standardized documentation pages with code examples you can copy and paste into your Node.js app (e.g. Github.createRepo()).
Building a machinepack? Here are some tips:
"repository"
key to your package.json file so folks can find your source code (this enables the View Source
button in the generated documentation on node-machine.org)This is a low-level module for building, configuring, and running machines.
Normal users of machines won't interact with this module directly very often-- however it is a dependency of every machinepack. Its full list of responsibilities includes exposing the conventional machine usage, a .exec()
helper (for familiarity with Waterline), as well as validating input expectations, coercing return values from exits, and more.
The .build()
method accepts a machine definition object and returns a new ready-to-use machine instance function. The .pack()
method accepts a filesystem path and returns a ready-to-use machinepack obtained by requiring the module located at the path, loading its machine definitions into live machines (calling .build()
on each definition), and validating that everything is up to spec.
So when you require a machinepack from NPM like so:
var Github = require('machinepack-github');
what's actually happening is that the index.js
file in the machinepack module is calling .pack()
and returning an object of ready-to-go machine instances.
There are only two use-cases for requiring this module directly:
index.js
fileNote that this is taken care of for you if you used the Yeoman generator to create your machinepack.
If you're implementing a machinepack, you'll need to use this module to .pack()
your machines in your index.js
file. Here's an example of an index.js
file (this example happens to come from machinepack-urls- your pack's index.js
file should always look the same, no matter what).
Normally, if you want to use a machine from inside of one of your machines, you just install and require the other machinepack in your pack and use it just like you would in app-level code. But if you want to use another machine in the same pack, or you want the machine to call itself recursively, you should use this module directly. You can read more information on this in the FAQ for implementors.
You can use it anywhere you like! For instance, you might want to implement a one-off machine in your app, perhaps to take advantage of caching or type-checking this module provides.
If you're using Sails, check out
sails-hook-machines
, a hook which allows you to use custom closed-source machines in your Sails app by dropping files into theapi/machines/
folder.
MIT © 2014 Mike McNeil; © 2015-2017 The Sails Company
Like the Sails framework, this package is available under the MIT license.
FAQs
Build functions in standardized containers.
The npm package machine receives a total of 50,412 weekly downloads. As such, machine popularity was classified as popular.
We found that machine demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.